#pragma once

#include "OptionsDlg.h"

class CSkypeOptions : public COptionsDlg
{
	CSkypePluginB* m_pOwner;
public:
	void Init
		( IN LPARAM lParam
		)
	{
		m_pOwner = (CSkypePluginB*)lParam;
	}

	bool IsStatusEnabled()
	{
		_tstring strValue = m_pOwner->ReadIniFileSetings(_T("GeoStatusEnabled"));
		return strValue.empty() || 0 == strValue.compare(_T("true"));
	}

	void SetStatusEnabled
		( IN bool bEnabled
		)
	{
		m_pOwner->WriteIniFileSetings(_T("GeoStatusEnabled"), bEnabled? _T("true"): _T("false"));
	}

	_tstring GetUserName()
	{
		return m_pOwner->ReadIniFileSetings(_T("UserName"));
	}

	void SetUserName
		( IN const _tstring& strUserName
		)
	{
		m_pOwner->WriteIniFileSetings(_T("UserName"), strUserName);
	}

	bool IsPasswordEmpty()
	{
		return m_pOwner->ReadIniFileSetings(_T("PasswordHash")).empty();
	}

	void SetPasswordHash
		( IN const std::string& strPasswordHash
		)
	{
		m_pOwner->WriteIniFileSetings(_T("PasswordHash"), (LPCTSTR)ATL::CA2TEX<64>(strPasswordHash.c_str(), CP_UTF8));
	}
};
